﻿using Newtonsoft.Json;
using Simple.Tools;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.IO;
using System.Net.Http;
using System.Text;

/*********************************************************
 * 命名空间 Simple.Http
 * 接口名称 IReponse
 * 开发人员：ADMIN
 * 创建时间：2023/8/17 11:05:51
 * 描述说明：
 * 更改历史：
 * 
 * *******************************************************/
namespace Simple.Http
{
	/// <summary>
	/// 
	/// </summary>
	public interface IResponse
	{
		/// <summary>
		/// 收到相应之后处理回调
		/// </summary>
		/// <typeparam name="TValue"></typeparam>
		/// <param name="action"></param>
		/// <returns></returns>
		public IResponse Then<TValue>(Action<TValue> action);

		/// <summary>
		/// 收到相应之后处理回调
		/// </summary>
		/// <typeparam name="TValue"></typeparam>
		/// <param name="action"></param>
		/// <returns></returns>
		public IResponse Then<TValue>(Action<TValue,string> action);


		/// <summary>
		/// 收到相应之后处理回调
		/// </summary>
		/// <param name="action"></param>
		/// <returns></returns>
		public IResponse Then(Action<string> action);


		/// <summary>
		/// 收到相应之后处理回调
		/// </summary>
		/// <param name="action"></param>
		/// <returns></returns>
		public IResponse Then(Action<string,string> action);


		/// <summary>
		/// 收到相应之后处理回调
		/// 收到数据文件类型可以使用该方法做回调处理
		/// </summary>
		/// <param name="action"></param>
		/// <returns></returns>
		public IResponse ThenResponse(Action<HttpResponseMessage> action);


		/// <summary>
		///错误信息的处理
		/// </summary>
		/// <param name="action"></param>
		/// <returns></returns>
		public IResponse ExceptionError(Action<Exception> action);


		/// <summary>
		/// 错误的处理
		/// </summary>
		/// <param name="action"></param>
		/// <returns></returns>
		public IResponse Error(Action<HttpResponseMessage, Exception> action);

	}
}
